#include "MenuManager.h"
#include "BaseApplication.h"
#include "utility.h"

MenuManager* Ogre::Singleton<MenuManager>::ms_Singleton = 0;
MenuManager g_singletonMenuManager;
MenuManager::MenuManager():
	isActive(false)
{

}
bool MenuManager::Initialization()
{
	PRINT("MenuManager:Initialization Start");
	if(!isInit)
	{
		mWmg = CEGUI::WindowManager::getSingletonPtr();
		isInit = true;
	}
	PRINT("MenuManager:Initialization End");
	return true;
}

void MenuManager::ActiveWindow(CEGUI::String name)
{
	PRINT(("CEGUI:Active window:"+name).c_str());
	CEGUI::Window *Root = this->mWmg->loadWindowLayout(name);
	CEGUI::System::getSingleton().setGUISheet(Root);
	CEGUI::FrameWindow* root = static_cast<CEGUI::FrameWindow*>(mWmg->getWindow("Root/Window"));
	//Root->hide();
	this->isActive =true;
}

void MenuManager::Deactive(bool uninstall)
{
	this->isActive = uninstall;
}

void MenuManager::DeactiveAll()
{

}

void UnloadCurrentUI()
{
}

bool MenuManager::IsMenuActive()
{
	return this->isActive;
}